package Controlers;

import javax.sound.midi.MidiSystem;
import Util.MidiPlayer;

public class SoundControler {

	private MidiPlayer musicPlayer;
	private MidiPlayer hitPlay;
	
	public void playBackgroundMusic(){
		
        try{
            musicPlayer = new MidiPlayer();
            musicPlayer.play(MidiSystem.getSequence(getClass().getResource(
                    "/Sounds/thor.mid")), true);
        }
        catch (Exception e){
            //throw new RuntimeException(e);
        }
        
    }
	
	public void stopBackgroundMusic(){
		
		try{
            musicPlayer.stop();
        }
        catch (Exception e){
            //throw new RuntimeException(e);
        }
	}
	
	public void playshootdMusic(){
		
        try{
            hitPlay = new MidiPlayer();
            hitPlay.play(MidiSystem.getSequence(getClass().getResource(
                    "/Sounds/oi.mid")), false);
        }
        catch (Exception e){
            //throw new RuntimeException(e);
        }
    }
}
